package org.jivesoftware.smackx.provider;

import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smackx.packet.MultipleAddresses;
import org.xmlpull.v1.XmlPullParser;

public class MultipleAddressesProvider
  implements PacketExtensionProvider
{
  public PacketExtension parseExtension(XmlPullParser paramXmlPullParser)
    throws Exception
  {
    int i = 0;
    MultipleAddresses localMultipleAddresses = new MultipleAddresses();
    while (true)
    {
      int j;
      label116: 
      do
        while (true)
        {
          do
          {
            if (i != 0)
              return localMultipleAddresses;
            j = paramXmlPullParser.next();
            if (j != 2)
              break label116;
          }
          while (!(paramXmlPullParser.getName().equals("address")));
          localMultipleAddresses.addAddress(paramXmlPullParser.getAttributeValue("", "type"), paramXmlPullParser.getAttributeValue("", "jid"), paramXmlPullParser.getAttributeValue("", "node"), paramXmlPullParser.getAttributeValue("", "desc"), "true".equals(paramXmlPullParser.getAttributeValue("", "delivered")), paramXmlPullParser.getAttributeValue("", "uri"));
        }
      while ((j != 3) || (!(paramXmlPullParser.getName().equals(localMultipleAddresses.getElementName()))));
      i = 1;
    }
  }
}